-
-
Notifications
You must be signed in to change notification settings - Fork 20.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Vector4 to VisualShader #60175
Add Vector4 to VisualShader #60175
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/godotengine/godot/blob/67957f5faaeaf03e78de8eb89524d0582294750f/scene/resources/visual_shader_nodes.cpp#L2723-L2728 requires your attention - OneMinus operator does not work with Vector4 currently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/godotengine/godot/blob/67957f5faaeaf03e78de8eb89524d0582294750f/scene/resources/visual_shader.cpp#L2679-L2680 Add BIND_ENUM_CONSTANT(VARYING_TYPE_VECTOR_4D);
to generate binding
67957f5
to
6f67193
Compare
@Chaosus I overlooked a few things, but they should be fixed now:
|
@Geometror Hmm, I think vec4 varyings does not working correctly - check it please: |
6f67193
to
cf58d23
Compare
Missing branch in the get_port_type function used by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks correct for me for now. Thanks for this contribution, for good and qualitative work from you as usual.
Approach looks good to me too, fantastic work! |
Thanks! |
Split from #59970, this PR adds Vector4 to VisualShader without introducing a new variant type. 'Quaternion' is used to transfer data to the shader instead of 'Plane' since its internal structure is more similar to a general Vector4 type (component names: xyzw, 4 floats instead of one normal Vector3 plus the displacement component). Still feels a bit off to use a Quaternion for that, but as #59970 requires more discussion or won't be merged at all, I think its ok for now (also, it can easily be changed).
Closes godotengine/godot-proposals#3761
Detailed changes: